//
//  ZWBaseCollecView.m
//  WanEr
//
//  Created by 高文萍 on 15/12/29.
//  Copyright © 2015年 高文萍. All rights reserved.
//

#import "ZWBaseCollecView.h"

@implementation ZWBaseCollecView

#pragma 自定义collection
- (instancetype)initWithFrame:(CGRect)frame
           flowLayoutItemSize:(CGSize)size
                       xSpace:(CGFloat)x ySpace:(CGFloat)y
                 sectionInset:(UIEdgeInsets)inset
                         cell:(Class)cell
                        reuse:(NSString *)reuse
{
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc]init];
    flowLayout.itemSize = size;
    flowLayout.minimumLineSpacing = x;
    flowLayout.minimumInteritemSpacing = y;
    flowLayout.sectionInset = inset;
    
    // 初始化
    if (self = [super initWithFrame:frame collectionViewLayout:flowLayout]) {
        
        [self registerClass:cell forCellWithReuseIdentifier:reuse];
        
    }
    
    self.backgroundColor = [UIColor whiteColor];
    
    return self;
    
}

@end
